package com.guigu.userservice.controller;

import com.guigu.common.utils.R;
import com.guigu.userservice.entity.StatisticsData;
import com.guigu.userservice.service.StatisticsDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/statistics")
public class StatisticsController {

    @Autowired
    private StatisticsDataService statisticsService;

    @GetMapping("/today")
    public R getTodayStatistics() {
        StatisticsData data = statisticsService.getTodayStatistics();
        return R.ok().data("stats", data);
    }
}